# Contributor: Oleg Titov <oleg.titov@gmail.com>
# Maintainer: Oleg Titov <oleg.titov@gmail.com>
pkgname=py3-murmurhash
pkgver=1.0.2
pkgrel=0
pkgdesc="Cython bindings for MurmurHash2"
options="!check" # Requires older version of pytest
url="https://github.com/explosion/murmurhash"
arch="all"
license="MIT"
depends="python3"
makedepends="python3-dev py3-setuptools cython"
checkdepends="py3-pytest py3-mmh3"
subpackages="$pkgname-doc"
source="murmurhash-$pkgver.tar.gz::https://github.com/explosion/murmurhash/archive/v$pkgver.tar.gz"
builddir="$srcdir/murmurhash-$pkgver"

prepare() {
	default_prepare
	sed -i 's|^#!/usr/bin/env|#!/usr/bin/env python3|g' bin/cythonize.py
}

build() {
	python3 setup.py build
}

check() {
	PYTHONPATH="$(echo $PWD/build/lib.*)" pytest-3 murmurhash
}

package() {
	python3 setup.py install --prefix=/usr --root="$pkgdir"

	install -Dm644 README.rst "$pkgdir/usr/share/doc/$pkgname/README.rst"
}

sha512sums="b835b5c9f9439f5e335bcc6921732d22c93ac304b7dd02d7060942ad00e8511d63a85faa5d74541324ca2e130a6ba18d67e905ca715e050086d0d986ac82f582  murmurhash-1.0.2.tar.gz"
